package research.sbookmarking.io;

import java.io.*;
import java.util.zip.GZIPInputStream;

public class DataInputStreamFactory extends InputStreamFactory{

	private static DataInputStreamFactory anInstance = null;
	
	private DataInputStreamFactory () {
		
	}
	
	@Override
	protected InputStream openInputStream (String filename){
		try {
			return new GZIPInputStream (super.openInputStream(filename));
		}
		catch (IOException e){
			throw new RuntimeException(e);
		}
	}
	
	public static InputStreamFactory getInstance(){
		if (anInstance == null) {
			anInstance = new DataInputStreamFactory();
		}
		

		return anInstance;
	}
}
